for (var n = 1; n <= 10000; n++){
    var now = n;
    var tmp = n;
    var sum = 0;
    tmp--;
    while(tmp)
    {
      if (now % tmp == 0)
      {
          sum += tmp;
          if (sum == now && tmp == 1)

        
            console.log(now + "是一个完美数");
      }
      tmp--;
    }
}
